package com.ldzy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class FirstController {
    @RequestMapping("/")
    public  String sayHello(){
        System.out.println("hello spring mvc");
        return  "success";
    }
    @RequestMapping(value = "/home/user/{id}",method = {RequestMethod.GET,RequestMethod.POST})
    public  String sayhome(@PathVariable("id")  int id){
        System.out.println("hello spring mvc"+id);
        return "home";
    }
}
